<template>
  <div class="content">
    <van-field class="pwd" v-model="password" placeholder="请输入密码" />
    <van-button round size="large" color="#f2270c" @click="register" type="info">点击提交</van-button>
  </div>
</template>

<script>
import Vue from 'vue'
import { Field, Button } from 'vant'
import { dofinishregister } from '@/api/user'

Vue.use(Field)
Vue.use(Button)
export default {
  data () {
    return {
      password: ''
    }
  },
  methods: {
    async register () {
      var data = {
        tel: localStorage.getItem('tel'),
        password: this.password
      }
      var res = await dofinishregister(data)
      if (res.code === '200') {
        localStorage.removeItem('tel')
        this.$router.go(-3)
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
body
  background-color #fff
.pwd
  border-bottom 1px solid #eee
  margin-bottom .5rem
</style>
